package com.tidc.consumer8001.controller.found;

import com.tidc.commonality.api.StudentFoundApi;
import com.tidc.commonality.ov.UserOV;
import com.tidc.commonality.pojo.Works;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassNmae StudentFoundController
 * @Description TODO
 * @Author 冯涛滔
 **/
@CrossOrigin
@RestController
@RequestMapping
public class StudentFoundController {
	@Autowired
	StudentFoundApi studentFoundApi;
	@ApiOperation("学生报名比赛的接口需要比赛的所有信息包含name brief和works_matchs_id logo url" )
	@RequestMapping(value = "/student/found/match",method = RequestMethod.POST)
	public UserOV foundWorks(Works works, String toekn){
		return studentFoundApi.foundWorks(works,toekn);
	}

	@ApiOperation("学生修改自己的项目") //需要将文件上传之后将之前的文件删除
	@RequestMapping(value = "/student/found/match",method = RequestMethod.PUT)
	public UserOV putWorks(Works works,String token){
		return studentFoundApi.putWorks(works,token);
	}

	@ApiOperation("学生为自己的队伍增加队员 需要队员的email 和 队伍的id")
	@RequestMapping(value = "/student/add/member",method = RequestMethod.POST)
	public UserOV addMenber(String token,String email ,int id){
		return studentFoundApi.addMenber(token,email,id);
	}
}
